package detector;

import model.Constants;

/**
 * Implementation de l'interface WheelDetector sous la forme d'un singleton.
 */
public class WheelDetectorImpl implements WheelDetector {

	private static WheelDetector wheelDetectorInstance;		// Instance du singleton
	
	private float position;									// Position de la molette
	
	public static WheelDetector wheelDetectorInstance() {
		if(wheelDetectorInstance == null) {
			wheelDetectorInstance = new WheelDetectorImpl();
		}
		
		return wheelDetectorInstance;
	}
	
	private WheelDetectorImpl() {
		position = Constants.DEFAULT_WHEEL_VALUE;
	}
	
	@Override
	public float getPosition() {
		return position;
	}

	@Override
	public void setPosition(float position) {
		this.position = position;	
	}

}
